(function() {

	window.nameLink = function (cellData, dom) {
		var id = dom.children().eq(0).html();
		var url = keter.path+'/paper/report/view/'+id;
		return '<a href="'+url+'">' + cellData + '</a>';
	};
	
	window.downloadFile = function (cellData) {
		//alert(cellData)
		if(cellData=="null"||cellData=="-"){
			return '无';
		}
		url = keter.path+'/paper/report/download/'+cellData;
		return '<a href="'+url+'">下载</a>';
	};	
	
	window.getAuthor = function (cellData, dom, data) {
		//alert(data.name);
		return data.name;
	};
	
	window.confirm = function (cellData, dom, data) {
		var id = dom.children().eq(0).html();
		var url = keter.reqRoot+'/add/'+id;
		return '<a href="'+url+'">审核</a>';
	};
	
	var get = function () {
		$.ajax({
			url: keter.reqRoot + '/getReport',
			context: document.body
		}).done(function(data) {
			$('.kt_table').createTable({
				data : data
			});
		});
	};

	var main = function () {
		get();
	};

	return main();
})();
